<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/templates/GeneralTemplate.xhtml">
	<ui:define name="content">
		<h:form id="userForm">
			<h:panelGrid columns="3"
				rowClasses="jsfcrud_odd_row,jsfcrud_even_row">
				<h:outputText value="#{label.email}:" />
				<h:inputText id="email" required="true"
					value="#{registration.email}" />
				<h:message for="email" class="error" />

				<h:outputText value="#{label.repeat_email}:" />
				<h:inputText id="emailRepeat" required="true"
					value="#{registration.emailRepeat}" />
				<h:message for="emailRepeat" class="error" />

				<h:outputText value="#{label.password}:" />
				<h:inputSecret id="password" required="true"
					value="#{registration.password}" />
				<h:message for="password" class="error" />

				<h:outputText value="#{label.repeat_password}:" />
				<h:inputSecret id="passwordRepeat" required="true"
					value="#{registration.passwordRepeat}" />
				<h:message for="passwordRepeat" class="error" />

				<h:outputText value="#{label.name}:" />
				<h:inputText id="name" required="true" value="#{registration.name}" />
				<h:message for="name" class="error" />

				<h:outputText value="#{label.surname}:" />
				<h:inputText id="surname" value="#{registration.surname}" />
				<h:message for="surname" class="error" />

				<h:outputText value="#{label.nationality}:" />
				<h:inputText id="nationality" value="#{registration.nationality}" />
				<h:message for="nationality" class="error" />

				<h:outputText value="#{label.dateOfBirth}:" />
				<h:panelGroup id="dateOfBirth">
					<h:selectOneMenu value="#{registration.day}">
						<f:selectItem itemLabel="#{label.day}" itemValue="#{null}" />
						<f:selectItems value="#{registration.days}" />
					</h:selectOneMenu>
					<h:selectOneMenu value="#{registration.month}">
						<f:selectItem itemLabel="#{label.month}" itemValue="#{null}" />
						<f:selectItems value="#{registration.months}" />
					</h:selectOneMenu>
					<h:selectOneMenu value="#{registration.year}">
						<f:selectItem itemLabel="#{label.year}" itemValue="#{null}" />
						<f:selectItems value="#{registration.years}" />
					</h:selectOneMenu>
				</h:panelGroup>
				<h:message for="dateOfBirth" class="error" />

				<h:outputText value="#{label.country}:"></h:outputText>
				<h:selectOneMenu id="country" value="#{registration.country}"
					converter="#{countryConverter}"
					valueChangeListener="#{registration.countryChanged}">
					<f:selectItem itemLabel="#{label.pleaseSelect}" itemValue="#{null}" />
					<f:selectItems value="#{staticValues.countries}" />
					<f:ajax render="city" execute="@this" event="valueChange" />
				</h:selectOneMenu>
				<h:message for="country" class="error" />

				<h:outputText value="#{label.city}:"></h:outputText>
				<h:selectOneMenu id="city" value="#{registration.city}"
					converter="#{cityConverter}">
					<f:selectItem itemLabel="#{label.pleaseSelect}" itemValue="#{null}" />
					<f:selectItems value="#{registration.cities}" />
				</h:selectOneMenu>
				<h:message for="city" class="error" />

				<h:outputText value="#{label.language}:"></h:outputText>
				<h:selectOneMenu id="language" value="#{registration.language}"
					converter="#{languageConverter}">
					<f:selectItems value="#{staticValues.languages}" />
				</h:selectOneMenu>
				<h:message for="language" class="error" />

				<h:outputText value="&nbsp;" />
				<h:commandLink value="#{label.create}" class="button-link"
					action="#{registration.createValidUser}" />
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>
</html>